home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3x / cpusetMove.z / cpusetMove
Encoding:
Text File  |  2002-10-03  |  5.7 KB  |  133 lines

  1.  
  2.  
  3.  
  4. ccccppppuuuusssseeeettttMMMMoooovvvveeee((((3333xxxx))))                                                  ccccppppuuuusssseeeettttMMMMoooovvvveeee((((3333xxxx))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      cpusetMove - move processes associated with an ID to another cpuset
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      ####iiiinnnncccclllluuuuddddeeee <<<<ccccppppuuuusssseeeetttt....hhhh>>>>
  13.  
  14.      iiiinnnntttt ccccppppuuuusssseeeettttMMMMoooovvvveeee((((cccchhhhaaaarrrr ****ffffrrrroooommmm____qqqqnnnnaaaammmmeeee,,,, cccchhhhaaaarrrr ****ttttoooo____qqqqnnnnaaaammmmeeee,,,, iiiinnnntttt iiiiddddttttyyyyppppeeee,,,,
  15.                iiiinnnntttt66664444____tttt iiiidddd))));;;;
  16.  
  17.  
  18. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  19.      The _c_p_u_s_e_t_M_o_v_e function is used to temporarily move processes associated
  20.      with an ID, identified by _iiii_dddd from one cpuset to another.  This function
  21.      does not move the memory associated with the processes.  This function
  22.      should be used in conjuction with _cccc_pppp_uuuu_ssss_eeee_tttt_MMMM_oooo_vvvv_eeee_MMMM_iiii_gggg_rrrr_aaaa_tttt_eeee.
  23.  
  24.      The _ffff_rrrr_oooo_mmmm______qqqq_nnnn_aaaa_mmmm_eeee argument is the name of the cpuset from which the
  25.      processes are moved. Using a NULL for this argument will result in having
  26.      all the processes identified by _iiii_dddd to be move into the global cpuset.
  27.      The global cpuset is a term used to describe all the CPUS that are not in
  28.      a cpuset.
  29.  
  30.      The _tttt_oooo______qqqq_nnnn_aaaa_mmmm_eeee argument is the name of the destination cpuset for the
  31.      specified ID.  Using a NULL for this argument will result in having all
  32.      the processes identified by _iiii_dddd to be moved into the global cpuset.
  33.  
  34.      The _iiii_dddd_TTTT_yyyy_pppp_eeee argument defines the type of number passed in as _iiii_dddd.  The
  35.      possible options for _iiii_dddd_TTTT_yyyy_pppp_eeee are _CCCC_PPPP_UUUU_SSSS_EEEE_TTTT______PPPP_IIII_DDDD (Process ID), _CCCC_PPPP_UUUU_SSSS_EEEE_TTTT______AAAA_SSSS_HHHH
  36.      (Array Session Handle), _CCCC_PPPP_UUUU_SSSS_EEEE_TTTT______PPPP_GGGG_IIII_DDDD (Process Group ID), _CCCC_PPPP_UUUU_SSSS_EEEE_TTTT______SSSS_IIII_DDDD
  37.      (Session ID), and _CCCC_PPPP_UUUU_SSSS_EEEE_TTTT______JJJJ_IIII_DDDD (Job ID).  The use of _CCCC_PPPP_UUUU_SSSS_EEEE_TTTT______JJJJ_IIII_DDDD will result
  38.      in an ENOPKG error on systems running the IRIX maintenance stream, or
  39.      those running the IRIX feature stream but without the job limits package
  40.      installed.
  41.  
  42.      This function requires the processes associated with _iiii_dddd to be stopped
  43.      before it can enact the move.  A test is made to see if all the processes
  44.      are stopped.  If _iiii_dddd has processes A, B, and C and B is stopped, A and C
  45.      will be stopped. Then, after the move, A and C will be restarted (but not
  46.      B).
  47.  
  48.      This function requires root privileges on standard IRIX, and
  49.      CAP_SCHED_MGMT on Trusted IRIX (TRIX).
  50.  
  51. EEEEXXXXAAAAMMMMPPPPLLLLEEEESSSS
  52.      This example moves a process ID from the cpuset queue named mpi_set to
  53.      the cpuset queue named my_set.
  54.  
  55.                char *from_qname = "mpi_set";
  56.                char *to_qname = "my_set";
  57.                int64_t id = 1534;
  58.  
  59.                /* move from mpi_set to my_set,
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. ccccppppuuuusssseeeettttMMMMoooovvvveeee((((3333xxxx))))                                                  ccccppppuuuusssseeeettttMMMMoooovvvveeee((((3333xxxx))))
  71.  
  72.  
  73.  
  74.                 * if error - print error & exit
  75.                 */
  76.                if (!cpusetMove(from_qname, to_qname, CPUSET_PID,
  77.                                                id)) {
  78.                    perror("cpusetMove");
  79.                    exit(1);
  80.                }
  81.  
  82.  
  83. NNNNOOOOTTTTEEEESSSS
  84.      _c_p_u_s_e_t_M_o_v_e is found in the library "libcpuset.so", and will be loaded if
  85.      the option _----_llll_cccc_pppp_uuuu_ssss_eeee_tttt is used with _cccc_cccc(1) or _llll_dddd(1).
  86.  
  87. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  88.      cpuset(1), cpusetCreate(3x), cpusetMoveMigrate(3x), cpuset(5).
  89.  
  90. DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
  91.      If successful, _c_p_u_s_e_t_M_o_v_e returns a 1.  If _c_p_u_s_e_t_M_o_v_e fails, it returns
  92.      the value 0 and eeeerrrrrrrrnnnnoooo is set to indicate the error.  The possible values
  93.      for eeeerrrrrrrrnnnnoooo are the same as those used by _s_y_s_m_p(2).  With any error, an
  94.      attempt is made to move the processes back to their originating cpuset.
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.                                                                         PPPPaaaaggggeeee 2222
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.